<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/layout/templateInformacao.xhtml"
                xmlns:c="http://java.sun.com/jsp/jstl/core">
    <ui:define name="content">

            <h:form>

                <p>
                    <ui:insert name="content">

                    </ui:insert>
                </p>
                
                <p align="center">

                    <h:dataTable value="#{lanceController.carregarLances()}" var="lance" border="1" >

                    <h:column>  
                        <f:facet name="header">

                            <h:outputText value="Usuário" />

                        </f:facet>             
                        <h:outputText value="#{lance.usuario.nome}" />


                    </h:column>

                    <h:column>  
                        <f:facet name="header">

                            <h:outputText value="Leilão" />

                        </f:facet>      

                        <h:outputText value="#{lance.leilao.id}" />
                            
                    </h:column>

                    <h:column>  
                        <f:facet name="header">

                            <h:outputText value="Data do Lance" />

                        </f:facet>             
                        <h:outputText value="#{lance.data}">

                            <f:convertDateTime pattern="dd/MM/yyyy"/> 

                        </h:outputText>


                    </h:column>

                    <h:column>  
                        <f:facet name="header">

                            <h:outputText value="Hora do Lance" />

                        </f:facet>             
                        <h:outputText value="#{lance.hora}" />


                    </h:column>

                    <h:column>  
                        <f:facet name="header">
                            
                            <h:outputText value="Valor" />

                        </f:facet>             
                        <h:outputText value="#{lance.valor}" />


                    </h:column>

                    <h:column>

                        <f:facet name="header">

                            <h:outputText value="Editar"/>

                        </f:facet>



                    </h:column>

                    <h:column>

                        <f:facet name="header">

                            <h:outputText value="Excluir"/>

                        </f:facet>

                        <h:commandButton value="Excluir" action="#{lanceController.removerLance()}"/>

                    </h:column>



                </h:dataTable>
                    
                <br />
                    
                <h:commandButton value="Novo" action="cadastrarLance"/>

                </p>




                <br/>
                <h:messages style="font-size: 13px; color: white;"/>

            </h:form>

        
    </ui:define>
</ui:composition>
